
// BodyView.h : interface of the CBodyView class
//

class CBodyView : public CListView
{
public:	// index of menu
	enum { FILE_MENU = 0, EDIT_MENU, VIEW_MENU };
 static unsigned g_nMode;	//	odd is REG

 inline static BOOL isRegMode() { return (g_nMode & 1); };
 inline static bool isReportStyle(CListCtrl * pControl)
	{
		DWORD dwStyle = (pControl->GetStyle() & LVS_TYPEMASK);
		return (dwStyle == LVS_REPORT);
	}

protected: // create from serialization only
	bool CustomTrackMenu(CListCtrl * );
	void updateMsgBar(CFrameWnd * pFrameWnd);

	CBodyView();
	DECLARE_DYNCREATE(CBodyView)

// Attributes
	unsigned	m_nArrow;	//	desc or ascend

	CinfDoc* GetDocument() const;
	CImageList	m_imageSmall;
	CImageList	m_imageBig;
	CImageList	m_imageEmpty;
	CHeaderCtrl * m_pHeader;

public:	// Operations
	//e BOOL GetMode() const { return (m_nMode & 1); };
	BOOL toggleMode();
	void appendLine(CListCtrl * anobj, LPARAM );
	bool innerCopy(CListCtrl * );
	void OnEditSelectAll(CListCtrl * );

// Overrides
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate(); // called first time after construct
	bool doUpdateCmdUI();

// Implementation
public:
	virtual ~CBodyView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

// Generated message map functions
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnEditCmds(UINT nCommandID);
	afx_msg void OnViewStyle(UINT nCommandID);
	afx_msg void OnUpdateEditSel(CCmdUI *pCmdUI);
	afx_msg void OnIdleUpdateCmdUI(void);
	afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
	afx_msg void OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg LRESULT OnNextLineDDE(WPARAM wParam, LPARAM lParam);

	DECLARE_MESSAGE_MAP()

};

#ifndef _DEBUG  // debug version in BodyView.cpp
inline CinfDoc* CBodyView::GetDocument() const
   { return reinterpret_cast<CinfDoc*>(m_pDocument); }
#endif
